home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 26 / macformat_26.iso / Los 50 mejores / Mejoras del sistema / Smart Scroll / for Developers / About these files (read me) next >
Text File  |  1996-12-31  |  4KB  |  65 lines

  1. (If you have any questions, please email me at Marc@Kagi.com)
  2. --------------------------------------------
  3. About the SmartScroll programming interface
  4. --------------------------------------------
  5. Here’s how you can make your program work with proportional scrollbars when they’re available:
  6.  
  7.  
  8. _ There is nothing to do if the scrollbars in your program are automatically recognized by Smart Scroll. Run your program with Smart Scroll installed, and each time you see a scrollbar with an ‘X’ over the thumb, click the ‘pageUp’ or ‘pageDown’ area on either side of the thumb (as explained in ‘Smart Scroll docs’). The ‘X’ should disappear as the thumb is resized. Then quit your program and re-open it: If ‘X’s are gone, you’re done!
  9.  
  10.  
  11. _ If the ‘X’ reappears, it means SmartScroll can’t get enough information from your scrollbars. The library calls described below let you provide the missing information; only one of the calls is really necessary (SetSmartScrollInfo), the others are optional.
  12.  
  13. The information you pass is the proportion of the document that is displayed in a window: If your document has 100 lines and your window shows 20 of these lines, you pass 20/100.
  14.  
  15. Whenever this proportion changes, your code can call SmartScroll so the thumb size of the target scrollbar is adjusted.
  16.  
  17. Choose which files to add to your project from this set:
  18. SmartScrollAPI.h
  19. SmartScrollAPI.c
  20. SmartScrollAPI.p
  21. SmartScrollAPI 68K.lib
  22. SmartScrollAPI PPC.lib
  23.  
  24. See the ‘LScroller.cp example’ file (find:‘msy’) for an example of where to add the library calls in your code. These calls do nothing if SmartScroll is not installed on the user’s machine.
  25.  
  26. Note: To test your changes, hold down the Option key while opening the Smart Scroll control panel, then check the 'API Test' box. This disables the ‘guessing’ in Smart Scroll 2.01 and later, so the only scrollbars that will have a proportional thumb will be those you provide info for (with the exception of List Manager scrollbars which are always handled automatically).
  27.  
  28.  
  29. --------------------------------------------
  30. Routines
  31. --------------------------------------------
  32. Call SetSmartScrollInfo to set the Visible/Total proportion for a scrollbar. This is the main call to issue from your code:
  33.  
  34. extern pascal void SetSmartScrollInfo (ControlRef theScrollBar, long amountVisible , long amountTotal);
  35.  
  36. amountVisible is a 32bit value representing the size of the visible part of the document.
  37. amountTotal is a 32bit value representing the size of the whole document. 
  38.  
  39. amountVisible and amountTotal should be the same unit (pixels, lines, characters, frames, etc).
  40.  
  41.  
  42. --------------------------------------------
  43. This does the same as the call above but with a single parameter, so you may use the one that’s more convenient for you.
  44.  
  45. extern pascal void SetSmartScrollProp (ControlRef theScrollBar, Fract proportion);
  46.  
  47. proportion is a Fract value (32bit) representing the Visible/Total ratio.
  48.  
  49.  
  50. --------------------------------------------
  51. Call GetSmartScrollProp if you need to retrieve the last proportion you stored for this scrollbar. (optional)
  52.  
  53. extern pascal Fract GetSmartScrollProp (ControlRef theScrollBar);
  54.  
  55. The value returned will be 0 if there is Smart Scroll is not installed or no value was stored.  
  56.  
  57. --------------------------------------------
  58. Call DisposeAllSmartScrolls before your program Quits, to help SmartScroll free the memory it uses for data associated with your scrollbars. (optional)
  59.  
  60. extern pascal void DisposeAllSmartScrolls (void);
  61.  
  62. The memory is freed sooner and better if you issue this call.
  63.  
  64.  
  65. (If you have any questions, please email me at Marc@Kagi.com)